/*
 * This file is part of Cockpit.
 *
 * Copyright (C) 2015 Red Hat, Inc.
 *
 * Cockpit is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * Cockpit is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Cockpit; If not, see <http://www.gnu.org/licenses/>.
 */
@import "../../node_modules/@patternfly/patternfly/components/Page/page.css";
@import "../../node_modules/@patternfly/patternfly/components/Card/card.css";
@import "../lib/ct-card.scss";

#storage .pf-c-card {
    @extend .ct-card;
}

#storage {
    overflow: auto;
}

.pf-c-page__main {
    overflow: visible;
}

#storage .pf-l-gallery {
    --pf-l-gallery--GridTemplateColumns: 1fr;
}

#main-storage.pf-c-page,
#storage-detail .pf-c-page__main-section,
#storage-detail .pf-c-page__main-nav {
    padding: var(--pf-global--gutter);
    overflow: auto;
}

#main-storage > .pf-c-page__main {
    padding-bottom: var(--pf-global--spacer--md);
}

#storage .empty-panel-text,
#storage .ct-table-empty td {
    text-align: center;
    margin: 5px;
    color: var(--color-gray-9);
    font-size: var(--pf-global--FontSize--sm);
}

#storage .create-storage {
    margin-bottom: 10px;
}

@media (max-width: 1560px) {
    #storage .create-storage .col-lg-6 {
        width: 100%;
    }
}

#storage .create-storage button {
    margin-bottom: 5px;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

#storage .storage-sidebar .table {
    table-layout:fixed;
}

#storage .storage-sidebar .table td {
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

#storage_raids .row span,
#storage_vgs .row span,
#storage_drives .row span {
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#storage_raids .row span.raid-size,
#storage_vgs .row span.vg-size {
    text-align: right;
}

@media (min-width: 768px) {
    .storage-graph-container:nth-child(1) {
        padding-right: 5px;
    }
    .storage-graph-container:nth-child(2) {
        padding-left: 5px;
    }
}

.dialog-select-row-table {
    width: 100%;

}

.dialog-select-row-table td,
.dialog-select-row-table td:first-child {
    text-align: left;
    padding-top: 0.75em;
    padding-bottom: 0.75em;
    padding-left: 0px;
    padding-right: 0px;
    vertical-align: top;
    white-space: default;
    color: black;
    width: auto;
    height: auto;
    border-top: 1px solid #D1D1D1;
    border-bottom: 1px solid #D1D1D1;
}

.dialog-select-row-table td:first-child {
    padding-left: 0.75em;
    border-left: 1px solid #D1D1D1;
}

.dialog-select-row-table td:last-child {
    padding-right: 0.75em;
    border-right: 1px solid #D1D1D1;
}

.dialog-select-row-table th {
    font-weight: bold;
    text-align: left;
    color: var(--color-gray-11);
    padding: 0px;
    padding-top: 0.75em;
    padding-bottom: 0.75em;
    padding-left: 0px;
    padding-right: 0px;
}

.dialog-select-row-table th:first-child {
    padding-left: 0.75em;
}

.dialog-select-row-table th:last-child {
    padding-right: 0.75em;
}

.arming-zone .needs-arming {
    display: none;
}

.arming-zone.armed .needs-arming {
    display: block;
}

/* Slider
 */

.slider {
    display: block;
    margin: 10px 10px;
    height: 5px;
    white-space: nowrap;
    font-size: 0px;
    background-color: #ededed;
    box-shadow: inset 0 0 1px rgba(0,0,0,0.5);
    cursor: pointer;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
}

.slider-warning {
    background-color: #d4a096;
}

.slider-bar {
    position: relative;
    height: 5px;
}

.slider > .slider-bar > .slider-bar {
    border-right: 3px solid white;
    height: 5px;
    position: relative;
}

.slider > .slider-bar > .slider-bar {
    display: inline-block;
}

.slider > div:first-child {
    float: left;
    background-color: var(--color-link);
}

.slider-disabled > div:first-child {
    cursor: auto;
    background-color: #e7e7e7;
}

.slider-thumb {
    position: absolute;
    border-radius: 9px;
    background-color: var(--color-link);
    width: 18px;
    height: 18px;
    top: -6px;
    right: -9px;
    content: '.';
    cursor: pointer;
    border: 1px solid #006e9c;
    background-image: linear-gradient(to bottom,var(--color-link) 0%,var(--color-link) 100%);
    z-index: 1;
}

.slider-disabled .slider-thumb {
    background-color: #e7e7e7;
    border: 1px solid #d7d7d7;
    cursor: auto;
}

.size-slider td:nth-child(1) {
    width: 100%;
    padding: 0px;
}

.size-slider td {
    padding: 0px;
}

.size-slider .size-text {
    display: inline;
    width: 6em;
    text-align: right;
    margin: 2px;
}

.size-slider .size-unit {
    width: 5em !important;
}

td.storage-icon {
    width: 48px;
}

td.storage-icon .spinner {
    margin-top: 5px;
}

span.rate-gap {
    display: inline-block;
    width: 1em;
}

div.progress {
    width: 100%;
    height: var(--font-size-xs);
}

#detail-header div.progress {
    min-width: 250px;
}

td.usage-text {
    text-align: right;
}

td.job-description {
    width: 50%;
}

td.job-status {
    width: 15%;
    text-align: right;
}

td.job-action {
    text-align: right;
}

.detail-jobs {
    margin-top: 20px;
}

.storage-graph {
    height: 120px;
}

.action-dropdown-menu {
    right: 0px;
    left: auto;
    min-width: 0;
    text-align: left;
}

.content-item {
    width: 100%;
}

.content-item table {
    width: 100%;
}

td.content-name {
    text-align: left;
}

td.content-action {
    text-align: right;
}

td.content-action > div {
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

td.content-action .spinner {
    visibility: hidden;
}

table.mdraid-item {
    width: 100%;
}

td.mdraid-slot {
    width: 20px;
    text-align: center;
}

td.mdraid-states {
    width: 100px;
    text-align: right;
}

td.mdraid-states .state-danger {
    color: red;
}

td.mdraid-action {
    text-align: right;
    width: 10em;
}

table.vgroup-item {
    width: 100%;
}

td.vgroup-action {
    text-align: right;
}

.dialog-arrow {
    color: black;
    cursor: pointer;
}

.dialog-arrow .fa {
    width: 1em;
}

.dialog-item-tooltip {
    margin-left: 5px;
    white-space: nowrap;
}

.dialog-checkbox-text {
    width: 100%;
    display: flex;
    flex-direction: row;
}

.dialog-checkbox-text :nth-child(2) {
    flex: 1;
    margin-left: 0.5em;
}

.form-control[hidden] {
    display: none;
}

.modal-footer-teardown {
    text-align: left;
}

.content-level-1 {
    padding-left: 30px;
}
.content-level-2 {
    padding-left: 60px;
}
.content-level-3 {
    padding-left: 90px;
}
.content-level-4 {
    padding-left: 120px;
}
.content-level-5 {
    padding-left: 150px;
}
.content-level-6 {
    padding-left: 180px;
}
.content-level-7 {
    padding-left: 210px;
}
.content-level-8 {
    padding-left: 240px;
}
.content-level-9 {
    padding-left: 270px;
}
.content-level-10 {
    padding-left: 300px;
}

.tab-actions {
    float: right;
    margin-top: -15px;
}

.tab-actions button {
    margin-left: 0.3em;
}

a.disabled {
    color: var(--color-blue-5);
    text-decoration: none;
    cursor: not-allowed;
}

.listing-ct-body .tab-row-actions {
    display: inline-block;
    margin-left: 2em;
}

.listing-ct caption .pull-right {
    margin-right: 10px;
}


/* Make tooltips inside tables visible.
 */

td.storage-action {
    overflow: visible !important;
}

.units-table .cmd {
    font-family: monospace;
}

.units-table > tbody > tr > td:nth-child(1),
.units-table > thead > tr > th:nth-child(1) {
    border-right: none;
    white-space: nowrap;
    width: 1%;
}

.units-table > tbody > tr > td:nth-child(2),
.units-table > thead > tr > th:nth-child(2) {
    border-left: none;
    border-right: none;
    word-break: break-all;
}

.units-table > tbody > tr > td:nth-child(3),
.units-table > thead > tr > th:nth-child(3) {
    text-align: right;
    border-left: none;
    white-space: nowrap;
    width: 1%;
}

.network-keys-table td {
    vertical-align: baseline;
    padding-right: 10px;
}

.combobox-container .input-group {
    width: 100%;
}

/* Prevent long names from sticking out of dialog titles
 */

.modal-title {
    word-break: break-all;
}

.panel-heading .spinner-inline {
    vertical-align: middle;
    margin-left: 0.5ex;
}

.just-installed {
    margin-right: 1em;
}

.faded {
    transition: opacity 1s, visibility 1s;
    opacity: 0;
    visibility: hidden;
}

.modal-body .intermission {
    margin-top: 1.5ex;
    margin-bottom: 1ex;
    white-space: normal;
    line-height: 1.6666;
    color: rgb(54, 54, 54);
}

.modal-body .medskip {
    height: 2.5ex;
}

.modal-body .widest-title {
    visibility: hidden;
    height: 0px;
}

.radio-horizontal input[type=radio] {
    margin-top: 5px;
}

.radio-horizontal label {
    margin-right: 1em;
}

.key-slot-panel-remaining {
    margin-right: 1em;
}

.shrink {
    width: 1%;
    white-space: nowrap;
}

.key-slot-panel .key-type {
    padding-right: 1em;
}

.key-slot-panel .key-slot {
    padding-right: 2em;
}

.sigkey-hash {
    font-family: monospace;
    font-size: 200%;
}

.inline-pre {
    display: inline;
    padding: 4px;
}

.modal-dialog h3 {
    margin-top: 0;
    line-height: 24px;
}

.pficon.large {
    font-size: 200%;
}

.progressive-disclosure .form-group {
    padding-left: 20px;
}

.progressive-disclosure .form-group > :first-child {
    margin-left: -20px;
}

.progressive-disclosure .form-group > :not(:first-child) {
    margin-top: 0.5em;
    animation: showRemovalDisclosure ease-in-out 200ms;
}

@keyframes showRemovalDisclosure {
    0% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top left;
    }
    100% {
        opacity: 1;
        transform: scaleY(1);
    }
}

.modal-dialog .slot-warning {
    color: var(--color-form-field-error-text);
}

.modal-dialog .key-source .radio-horizontal {
    margin-bottom: 2ex;
}

.size-sliderx {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.size-sliderx .slider {
    flex: 1;
}

.size-sliderx .size-text {
    display: inline;
    width: 6em;
    text-align: right;
    margin: 2px;
}

.size-sliderx .size-unit {
    width: 5em !important;
}

.select-space-row {
    display: flex;
    align-items: center;
}

.select-space-row :nth-child(1) {
    margin-top: 0px;
}

.select-space-row :nth-child(2) {
    flex-grow: 1;
    margin-left: 10px;
}

.ct-form-box {
    margin-bottom: 1em;
}

/* Overview side panels */

#storage .storage-sidebar .table {
    table-layout: fixed;
}

.sidepanel-row {
    display: flex;
    flex-direction: row;
}

.sidepanel-row-detail {
    margin-right: 0.5em;
}

.sidepanel-row-body {
    flex: auto;
}

.sidepanel-row-info {
    font-size: var(--pf-global--FontSize--xs);
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
}

.sidepanel-row-decoration {
    align-self: center;
    white-space: nowrap;
    margin-left: 1em;
}

.sidepanel-row .spinner {
    display: inline-block;
}

.panel-heading {
    position: static;
}

.storage_alert_action_buttons button {
    margin: 0.5rem 0.2rem 0.2rem 0;
}
